package com.itheima.users4shopping.controller;

import com.itheima.goods.pojo.Address;
import com.itheima.users4shopping.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author wang
 * @description
 * @date 2021/7/31 14:46
 */
@RestController
@RequestMapping("/address")
public class AddressController {
    @Autowired
    private AddressService addressService;

    @GetMapping("/{username}")
    public List<Address> findByUserId(@PathVariable String username){
        return addressService.findByUserId(username);
    }
}
